import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ViewController } from 'ionic-angular';
import { StorageProvider } from '../../providers/storage/storage';

/**
 * Generated class for the SettingsPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-settings',
  templateUrl: 'settings.html',
})
export class SettingsPage {
  private route: any;

  constructor(
    public navCtrl: NavController,
    private viewCtrl: ViewController,
    public navParams: NavParams,
    private storage: StorageProvider) {
  }

  ionViewDidLoad() {
    let url = this.storage.get('server_url');
    this.route = url || 'http://111.230.254.233:8082/wms/commonAction.do';
  }
  dismiss() {
    this.storage.set('server_url', this.route);
    //返回到登录页
    this.viewCtrl.dismiss();

  }
}
